home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / dev / www-talk.9301-9306.Z / www-talk.9301-9306 / text0532.txt < prev    next >
Encoding:
Text File  |  1995-04-24  |  1.1 KB  |  39 lines

  1.  
  2. How should browsers deal with new-lines, and where can html-generators
  3. put in new-lines?
  4.  
  5. I spent quite a bit of time thinking about what is intuitively the right
  6. way to do it, and I came up with this method.
  7.  
  8. 0. Convert all new-lines inside of tags to spaces.
  9.  
  10. 1. For each tag NOT in
  11.      <PRE> </PRE> <A> </A> <PLAINTEXT>
  12.    remove ALL surrounding new-lines.
  13.  
  14. 2. For each tag in
  15.      <PRE> <PLAINTEXT>
  16.    remove ALL new-lines to left, and one new-line to the right.
  17.  
  18. 3. For each tag in
  19.      </PRE>
  20.    remove ALL new-lines to the right.
  21.  
  22. 4. Convert all remaining new-lines to spaces.
  23.  
  24. If XMP and LISTING sections are being used, they would be treated the
  25. same as PRE.
  26.  
  27. Note that this converts new-lines around anchors into spaces UNLESS they
  28. appear immediately at the beginning or end of some other element.
  29.  
  30. If browsers use this method, it would allow html-generators to put in
  31. new-lines all over the place for readability of HTML, without introducing
  32. lots of annoying extra spaces in the output.  This is what seems like
  33. the most useful thing to do, although I'm not sure it is "correct".
  34.  
  35. So is it correct?  And are there any obvious flaws?
  36.  
  37.        tom
  38.  
  39.